package com.springboot.service;

import com.springboot.dao.PeopleEntityMapper;
import com.springboot.entity.PeopleEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author WinterSun
 * @date 2020/9/26 - 15:22
 */
@Service
public class TestService {
    @Autowired
    private PeopleEntityMapper peopleEntityMapper;

    public PeopleEntity selectByPrimaryKey(Long id) {
        return peopleEntityMapper.selectByPrimaryKey(id);
    }

    @Transactional
    public Integer InsertMethod(PeopleEntity peopleEntity){
        int num = peopleEntityMapper.insert(peopleEntity);
        return num;
    }
}
